//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

/**
 * @author zhaoqiankun
 * @date 2021/11/10
 */
package com.qkjia.converter;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.context.ApplicationEvent;

public class KafkaConsumerEvent extends ApplicationEvent {
    private Long key;
    private String topic;
    private Object message;
    private Integer partition;
    private ConsumerRecord<Long, String> record;

    public KafkaConsumerEvent(Object source, String topic, Long key, Object message) {
        super(source);
        this.topic = topic;
        this.message = message;
        this.key = key;
    }

    public KafkaConsumerEvent(Object source, String topic, Long key, Integer partition, Object message) {
        super(source);
        this.topic = topic;
        this.message = message;
        this.partition = partition;
        this.key = key;
    }

    public String getTopic() {
        return this.topic;
    }

    public Object getMessage() {
        return this.message;
    }

    public Integer getPartition() {
        return this.partition;
    }

    public Long getKey() {
        return this.key;
    }

    public ConsumerRecord<Long, String> getRecord() {
        return this.record;
    }

    public void setRecord(ConsumerRecord<Long, String> record) {
        this.record = record;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("KafkaConsumerEvent{");
        sb.append("key='").append(this.key).append('\'');
        sb.append(",topic='").append(this.topic).append('\'');
        sb.append(", message='").append(this.message).append('\'');
        sb.append(", partition=").append(this.partition);
        sb.append('}');
        return sb.toString();
    }
}
